package com.bwie.config;


import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class rabbitMq {
    /**
     * @description:roomQueue
     * @author: sxting~😊
     * @Date: 2024/9/25 11:51
     * @return: com.bwie.utils.R
     **/
    @Bean
    public Queue roomQueue(){
        return new Queue("roomQueue",true);
    }
    /**
     * @description:directExchange
     * @author: sxting~😊
     * @Date: 2024/9/25 11:51
     * @return: com.bwie.utils.R
     **/
    @Bean
    public DirectExchange directExchange(){
        return new DirectExchange("directExchange");
    }

    /**
     * @description:binding
     * @author: sxting~😊
     * @Date: 2024/9/25 11:51
     * @return: com.bwie.utils.R
     **/
    @Bean
    public Binding binding(){
        return BindingBuilder.bind(roomQueue()).to(directExchange()).with("roomBinding");
    }
}
